package com.neu.edu.boonpay.utils;

import java.util.concurrent.atomic.AtomicLong;

public class TransactionIDGenerator {

    private static final AtomicLong counter = new AtomicLong(0);
    //private static final String PREFIX = "TRX"; // 交易ID前缀
    //private static final String SEPARATOR = "-"; // 分隔符

    public static synchronized String generateTransID() {
        long timestamp = System.currentTimeMillis(); // 获取当前时间戳
        long count = counter.incrementAndGet(); // 获取递增的计数器值
        return timestamp + count + "";
    }
}
